/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package agol.rent.system.sql;

/**
 *
 * @author mds1
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class KoneksiDB {
    
    private static Connection konek ;
    
     public static Connection getConnection() throws SQLException{
         if ( konek == null){
           //Driver driver = new Driver();
           konek = DriverManager.getConnection("jdbc:mysql://localhost:3306/Rent_shop_System",
             "jdbc", "rahasia");
         }
     return konek;
         }

  public static void main(String args[]){
   try {
      getConnection();
   System.out.println("Berhasil");
   } catch (SQLException ex){
   System.out.println("gagal");
   }
  }
}
